package com.dmooo.ymx.adapter;

import android.content.Context;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.dmooo.ymx.R;
import com.dmooo.ymx.bean.SetBean;
import com.dmooo.ymx.common.SPUtils;
import com.dmooo.ymx.config.Constants;
import com.dmooo.ymx.fragments.PinPaiFragment;
import com.dmooo.ymx.mallbean.MallCatbean;
import com.dmooo.ymx.merchantbean.MerchantGroupbean;
import com.dmooo.ymx.widget.CircleImageView;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

import me.panpf.sketch.SketchImageView;

public class HomeIconAdapter extends CommonAdapter<MerchantGroupbean> {
    public HomeIconAdapter(Context context, int layoutId, List<MerchantGroupbean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, MerchantGroupbean setBean, int position) {
        SketchImageView imageView = holder.getView(R.id.service_icon1);
        imageView.getOptions().setDecodeGifImage(true);
        if(mContext instanceof PinPaiFragment){
            imageView.displayImage( setBean.img);
        }else{
            imageView.displayImage(Constants.APP_IP + setBean.img);
        }
        holder.setText(R.id.service_name, setBean.cat_name);
    }
}
